<?xml version="1.0" encoding="UTF-8"?>

<!--
    Document   : feedToUserList.xsl
    Created on : June 7, 2013, 10:23 AM
    Author     : Hoang
    Description:
        Purpose of transformation follows.
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="html"/>
    <xsl:param name="userID"></xsl:param>
    <!-- TODO customize transformation rules 
         syntax recommendation http://www.w3.org/TR/xslt 
    -->
    <xsl:template match="/">
        <xsl:choose>
            <xsl:when test="//feed[userlist/userId=$userID]">
                <ul id="user-rss-list">
                    <xsl:apply-templates select="//feed[userlist/userId=$userID]"/>
                </ul>
            </xsl:when>
            <xsl:otherwise>
                <h4>Bạn chưa có feed nào trong danh sách. Hãy chọn 1 feed bên danh sách feed,
                hoặc thử thêm 1 feed mới để đọc tin.</h4>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>

    <xsl:template match="feed">
        <li>
            <a href="readFeed.action?rssID={feedId}" title="{decription}">
                <xsl:value-of select="title"/>
            </a>
        </li>
    </xsl:template>

</xsl:stylesheet>
